package xyz.xmh.pattern.creational.builderpattern;

/**
 * BuilderPatternDemo
 * 建造者模式演示类
 *
 * @author xuMingHai
 * @since 2021/4/29 星期四 11:42
 */
public class BuilderPatternDemo {

    public static void main(String[] args) {
        // 创建套餐建造者类
        MealBuilder mealBuilder = new MealBuilder();

        // 获取一号套餐
        Meal meal1 = mealBuilder.meal1();
        // 查看套餐一的所有物品
        meal1.showItems();
        // 查看这个套餐的总价格
        System.out.println("套餐一得总价格为：" + meal1.getTotalPrice());

        System.out.println();
        System.out.println();

        // 套餐二
        Meal meal2 = mealBuilder.meal2();
        meal2.showItems();
        System.out.println("套餐二得总价格为：" + meal2.getTotalPrice());
    }

}
